<template>
  <el-dialog title="修改角色" :visible.sync="dialogVisible" width="30%" class="popup" :before-close="handleClose">
    <!-- <el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
      <el-form-item label="角色名称" prop="pass">
        <el-input type="password" v-model="ruleForm.pass" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="平台权限" prop="checkPass">
        <el-input type="password" v-model="ruleForm.checkPass" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="APP权限" prop="age">
        <el-input v-model.number="ruleForm.age"></el-input>
      </el-form-item>
      <el-form-item label="部门权限" prop="age">
        <el-input v-model.number="ruleForm.age"></el-input>
      </el-form-item>
      <el-form-item label="角色描述" prop="age">
        <el-input v-model.number="ruleForm.age"></el-input>
      </el-form-item>
    </el-form> -->

    <!-- <el-tree :data="data" :props="defaultProps"></el-tree> -->

    <!-- <el-tree
      class="tree-line"
      icon-class="el-icon-circle-plus-outline"
      :indent="0"
      :data="data"
  ></el-tree> -->

    <el-form ref="ruleForm" :model="ruleForm" status-icon :rules="rules" label-width="100px" class="demo-ruleForm">
      <el-form-item label="审批类型" prop="pass">
        <el-select v-model="ruleForm.region" placeholder="请选择审批类型">
          <el-option label="按部门审批" value="shanghai" />
          <el-option label="个人审批" value="beijing" />
        </el-select>
      </el-form-item>
      <el-form-item label="审批级别" prop="pass">
        <el-select v-model="ruleForm.region" placeholder="请选择审批级别">
          <el-option label="一级" value="shanghai" />
          <el-option label="二级" value="beijing" />
          <el-option label="三级" value="beijing" />
        </el-select>
      </el-form-item>
      <el-form-item label="审批名称" prop="age">
        <el-input v-model="ruleForm.age" />
      </el-form-item>
      <el-form-item label="审批模块">
        <el-select v-model="ruleForm.region" placeholder="请选择审批级别">
          <el-option label="公告审批" value="shanghai" />
        </el-select>
      </el-form-item>
      <el-form-item label="审批分配">
        <el-select v-model="ruleForm.region" placeholder="请选择审批级别">
          <el-option label="职务" value="shanghai" />
          <el-option label="审批级别" value="shanghai" />
        </el-select>
      </el-form-item>
      <el-form-item label="备注">
        <el-input v-model="ruleForm.desc" type="textarea" />
      </el-form-item>
    </el-form>

    <span slot="footer" class="dialog-footer">
      <el-button size="small" @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" size="small" @click="dialogVisible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
  components: {
    Treeselect
  },
  data () {
    return {
      dialogVisible: false,
      ruleForm: {
        pass: '',
        checkPass: '',
        age: ''
      },

      value: null,
      // define options
      options: [{
        id: 'a',
        label: 'a',
        children: [{
          id: 'aa',
          label: 'aa'
        }, {
          id: 'ab',
          label: 'ab'
        }]
      }, {
        id: 'b',
        label: 'b'
      }, {
        id: 'c',
        label: 'c'
      }]
    }
  },
  computed: {
    rules () {
      return {
        pass: [
          { required: true, message: '请输入活动名称', trigger: 'blur' }
        ],
        checkPass: [
          { required: true, message: '请输入活动名称', trigger: 'blur' }
        ],
        age: [
          { required: true, message: '请输入活动名称', trigger: 'blur' }
        ]
      }
    }

  },
  methods: {
    togglePopup (flag) {
      this.dialogVisible = flag
    },
    handleClose (done) {
      this.$confirm('确认关闭？')
        .then(_ => {
          done()
        })
        .catch(_ => { })
    }
  }
}
</script>

<style lang="scss" scoped>
.popup {
  ::v-deep .el-dialog {
    border-radius: 4px;
  }
  ::v-deep .el-dialog__header {
    border-bottom: 1px solid #cdd0db;
  }
  ::v-deep .el-dialog__body {
    padding: 30px;
  }
}
</style>

